/**
 * @constant SHOW_LOADING
 * @memberOf kryfe-lib.Actions
 * @type {string}
 */
export const SHOW_LOADING = '@@system/SHOW_LOADING';

/**
 * @constant HIDE_LOADING
 * @memberOf kryfe-lib.Actions
 * @type {string}
 */
export const HIDE_LOADING = '@@system/HIDE_LOADING';

/**
 * 显示正在加载
 * @function showLoading
 * @memberOf kryfe-lib.Actions
 * @param text {string} 加载时显示的信息
 * @returns {{type: string, payLoad: {text: *}}}
 */
export function showLoading(text) {
  return {
    type: SHOW_LOADING,
    payload: text,
  };
}

/**
 * 隐藏正在加载
 * @function hideLoading
 * @memberOf kryfe-lib.Actions
 * @returns {{type: string}}
 */
export function hideLoading() {
  return {
    type: HIDE_LOADING,
  };
}
